package com.ruoyi.merchant.domain;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.CarInfo;
import com.ruoyi.common.core.domain.Shop;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 订单对象 service_order
 *
 * @author ruoyi
 * @date 2024-09-11
 */
@Document(indexName = "order")//指定类映射的索引库名+分片备份数量
public class ServiceOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 订单号
     */
    @Id // 表示当前属性为主键
    private Long id;

    /**
     * 核销码【UUID产生、唯一】
     */
    @Field(type = FieldType.Text)
    @Excel(name = "核销码【UUID产生、唯一】")
    private String verificationCode;

    /**
     * 店铺id
     */
    @Field(type = FieldType.Integer)
    @Excel(name = "店铺id")
    private Long mid;
    private Shop shop;
    /**
     * 用户id
     */
    @Field(type = FieldType.Integer)
    @Excel(name = "用户id")
    private Long uid;

    /**
     * 服务详情编号id
     */
    @Field(type = FieldType.Integer)
    @Excel(name = "服务详情编号id")
    private Long serviceId;
    private ServiceDetails serviceDetails;
    /**
     * 服务类别id
     */
    @Field(type = FieldType.Integer)
    @Excel(name = "服务类别id")
    private Long serviceTypeId;
    private ServiceType serviceType;
    /**
     * 下单时间
     */
    @Field(type = FieldType.Date)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date orderTime;

    /**
     * 预约时间
     */
    @Field(type = FieldType.Date)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预约时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date reservationTime;

    /**
     * 订单车辆id号
     */
    @Field(type = FieldType.Integer)
    @Excel(name = "订单车辆id号")
    private Long carId;

    private CarInfo carInfo;
    /**
     * 平台优惠卷id【每次只用使用一张】
     */
    @Field(type = FieldType.Integer)
    @Excel(name = "平台优惠卷id【每次只用使用一张】")
    private Long platformCouponId;

    /**
     * 商家优惠卷id【每次只用使用一张】
     */
    @Field(type = FieldType.Integer)
    @Excel(name = "商家优惠卷id【每次只用使用一张】")
    private Long shopCouponId;

    /**
     * 实付金额
     */
    @Field(type = FieldType.Double)
    @Excel(name = "实付金额")
    private Long price;

    /**
     * 支付时间
     */
    @Field(type = FieldType.Date)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date payTime;

    /**
     * 使用时间
     */
    @Field(type = FieldType.Date)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "使用时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date useTime;

    /**
     * 订单状态（0待支付、1待使用、2待评价、3已取消、4已退款、5已完成）
     */
    @Field(type = FieldType.Integer)
    @Excel(name = "订单状态", readConverterExp = "0=待支付、1待使用、2待评价、3已取消、4已退款、5已完成")
    private Long status;

    /**
     * 删除状态
     */
    @Field(type = FieldType.Integer)
    private Long deleted;

    /**
     * 最后修改
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后修改", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updataTime;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setVerificationCode(String verificationCode) {
        this.verificationCode = verificationCode;
    }

    public String getVerificationCode() {
        return verificationCode;
    }

    public void setMid(Long mid) {
        this.mid = mid;
    }

    public Long getMid() {
        return mid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public Long getUid() {
        return uid;
    }

    public void setServiceId(Long serviceId) {
        this.serviceId = serviceId;
    }

    public Long getServiceId() {
        return serviceId;
    }

    public void setServiceTypeId(Long serviceTypeId) {
        this.serviceTypeId = serviceTypeId;
    }

    public Long getServiceTypeId() {
        return serviceTypeId;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public void setReservationTime(Date reservationTime) {
        this.reservationTime = reservationTime;
    }

    public Date getReservationTime() {
        return reservationTime;
    }

    public void setCarId(Long carId) {
        this.carId = carId;
    }

    public Long getCarId() {
        return carId;
    }

    public void setPlatformCouponId(Long platformCouponId) {
        this.platformCouponId = platformCouponId;
    }

    public Long getPlatformCouponId() {
        return platformCouponId;
    }

    public void setShopCouponId(Long shopCouponId) {
        this.shopCouponId = shopCouponId;
    }

    public Long getShopCouponId() {
        return shopCouponId;
    }

    public void setPrice(Long price) {
        this.price = price;
    }

    public Long getPrice() {
        return price;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setUseTime(Date useTime) {
        this.useTime = useTime;
    }

    public Date getUseTime() {
        return useTime;
    }

    public void setStatus(Long status) {
        this.status = status;
    }

    public Long getStatus() {
        return status;
    }

    public void setDeleted(Long deleted) {
        this.deleted = deleted;
    }

    public Long getDeleted() {
        return deleted;
    }

    public void setUpdataTime(Date updataTime) {
        this.updataTime = updataTime;
    }

    public Date getUpdataTime() {
        return updataTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("verificationCode", getVerificationCode())
                .append("mid", getMid())
                .append("uid", getUid())
                .append("serviceId", getServiceId())
                .append("serviceTypeId", getServiceTypeId())
                .append("orderTime", getOrderTime())
                .append("reservationTime", getReservationTime())
                .append("carId", getCarId())
                .append("platformCouponId", getPlatformCouponId())
                .append("shopCouponId", getShopCouponId())
                .append("price", getPrice())
                .append("payTime", getPayTime())
                .append("useTime", getUseTime())
                .append("status", getStatus())
                .append("deleted", getDeleted())
                .append("updataTime", getUpdataTime())
                .toString();
    }
}
